package com.javakademi.tags;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 *
 * @author Bora SAYINER
 * @since Jan 9, 2015 10:51:35 PM
 * @version 1.0
 */
public class MenuTag extends SimpleTagSupport {

	private List<MenuItemTag> menuItems;

	public MenuTag() {
		this.menuItems = new ArrayList<MenuItemTag>();
	}

	@Override
	public void doTag() throws JspException, IOException {
		System.out.println("MenuTag");
		getJspBody().invoke(null);
		System.out.println("MenuTag");
	}

	void addMenuItem(MenuItemTag menuItem) {
		menuItems.add(menuItem);
	}
}
